Skip to content

Conversation

@chenuduss
Copy link
Contributor

Small PR with remove useless checks

@sonarqubecloud
Copy link

@airween
Copy link
Member

airween commented Nov 20, 2025

Thanks for this patch.

It seems good to me, I just realized that in the Transaction object there is no check for the nullptr value of the Rule argument, nothing at all. Probably we should add that into the constructor...

@airween airween merged commit b6da677 into owasp-modsecurity:v3/master Nov 20, 2025
50 checks passed
@chenuduss
Copy link
Contributor Author

chenuduss commented Nov 20, 2025

Any attempts to create Transaction with null pointer of rules (or invalid pointer) now impossible because segfault will be caused immidiately on line:

m_secXMLParseXmlIntoArgs(rules->m_secXMLParseXmlIntoArgs),

Therefore, in the current implementation, if the object is created and we are not in the constructor, then we can be sure that m_rules is valid. :-) This means that all existing library clients are guaranteed to ensure that the rules pointer is valid. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants